libxl/remus: setup and control disk replication for DRBD backends
authorYang Hongyang <yanghy@cn.fujitsu.com>
Fri, 18 Jul 2014 09:14:22 +0000 (17:14 +0800)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Fri, 26 Sep 2014 14:12:37 +0000 (15:12 +0100)
commitc03153348098fbdd905163af95ecbabbd43f31bb
tree19e4c37d88b9fd2c37b964b7a2bb5188165b5f0a
parent6e1b7ac4ed9367d5b475cf11d68b57a16a006b28
libxl/remus: setup and control disk replication for DRBD backends

This patch adds the machinery required for protecting a guest's
disk state, when the guest disk uses a DRBD disk backend.
This patch comprises of two parts:

1. Hotplug scripts: The block-drbd-probe script is responsible for
  performing sanity checks on the state of the DRBD disk before the
  checkpointing process begins. This script should be invoked by
  libxl for each of the guest's disk devices, when starting Remus.

2. Remus drbd disk device: Implements the interfaces required by the
   remus abstract device layer. A note about the implementation:

   a) setup() is called for each disk attached to the guest.
      During setup():
      i) The hotplug script is called to perform the sanity check.

      ii) Libxl obtains a handle to the DRBD device (/dev/drbd*) and
          and subsequently controls disk checkpoint replication using
          this handle in the checkpoint callbacks.

   c) The preresume() checkpoint callback is executed asynchronously
      using libxl__ev_child_fork(), as it may potentially block for more
      than few seconds in case of backup failure.

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Signed-off-by: Shriram Rajagopalan <rshriram@cs.ubc.ca>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
docs/README.remus
tools/hotplug/Linux/Makefile
tools/hotplug/Linux/block-drbd-probe [new file with mode: 0755]
tools/libxl/Makefile
tools/libxl/libxl.c
tools/libxl/libxl_internal.h
tools/libxl/libxl_remus_device.c
tools/libxl/libxl_remus_disk_drbd.c [new file with mode: 0644]